package cn.laixueit.resource;

import cn.laixueit.po.TbBookChapter;
import cn.laixueit.po.TbBookChapterContent;
import cn.laixueit.vo.BookVo;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author duxiang
 * @date 2024/2/20 16:05
 */
public interface BookInterface {
    @GetMapping("/blog/list")
    Object list();
    @PostMapping("/blog/page")
    Object page(@RequestParam(value = "page",defaultValue = "1")Integer page,
           @RequestParam(value = "size",defaultValue = "10")Integer size,
           @RequestBody BookVo bookVo);

    @PostMapping("/blog/save")
    Object save( @RequestBody BookVo bookVo);

    @DeleteMapping("/blog/remove")
    Object  remove(@RequestParam("id") String id,@RequestParam("isDelete")Boolean isDelete);

    @GetMapping("/blog/findById")
    Object findById(@RequestParam("id")String id);

    @GetMapping("/blog/findBookAndChapters")
    Object findBookAndChapters(@RequestParam("id")String id);

    @PostMapping("/blog/saveChapter")
    Object saveChapter(@RequestBody TbBookChapter chapter);

    @GetMapping("/blog/listChapter")
    Object listChapter(@RequestParam("bookId")String bookId);

    @DeleteMapping("/blog/removeChapter")
    Object removeChapter(@RequestParam("chapterId") String chapterId);

    @GetMapping("/blog/findChapterContent")
    Object findChapterContent(@RequestParam("chapterId")String chapterId);

    @PostMapping("/blog/saveChapterContent")
    Object saveChapterContent(@RequestBody TbBookChapterContent chapterContent);

    @GetMapping("/blog/findChapters")
    Object findChapters(@RequestParam("bookId")String bookId);
}
